<?php
namespace Home\Model;
/**
 * {0}
 *  
 * @author Quang Thanh
 * @version 
 */
	
use Zend\InputFilter\InputFilter;
use Zend\InputFilter\Factory as InputFactory;
use Zend\InputFilter\InputFilterAwareInterface;
use Zend\InputFilter\InputFilterInterface;

class Canhan implements InputFilterAwareInterface
{
	/**
	 * The default table name 
	 */
	
	public $id;
	public $cmt;
	public $hoten;
	public $ngaysinh;
	public $gioitinh;
	public $diachi;
	public $motabenh;
	public $dienthoai;
	public $chucvu;
	public $congtac;
	public $ngaykham;
	
    protected $inputFilter;
    
    
    /**
     * su dung ResultSet to pass data
     */
    
    public function exchangeArray($data) {
    	$this->id     = (isset($data['id'])) ? $data['id'] : null;
    	$this->cmt = (isset($data['cmt'])) ? $data['cmt'] : null;
    	$this->hoten  = (isset($data['hoten'])) ? $data['hoten'] : null;
    	$this->ngaysinh  = (isset($data['ngaysinh'])) ? $data['ngaysinh'] : null;
    	$this->gioitinh  = (isset($data['gioitinh'])) ? $data['gioitinh'] : null;
    	$this->diachi  = (isset($data['diachi'])) ? $data['diachi'] : null;
    	$this->motabenh  = (isset($data['motabenh'])) ? $data['motabenh'] : null;
    	$this->dienthoai  = (isset($data['dienthoai'])) ? $data['dienthoai'] : null;
    	$this->chucvu  = (isset($data['chucvu'])) ? $data['chucvu'] : null;
    	$this->congtac  = (isset($data['congtac'])) ? $data['congtac'] : null;
    	$this->ngaykham  = (isset($data['ngaykham'])) ? $data['ngaykham'] : null;
    }
    
    public function getArrayCopy() {
    	return get_object_vars($this);
    }
	/* (non-PHPdoc)
	 * @see \Zend\InputFilter\InputFilterAwareInterface::setInputFilter()
	 */
	public function setInputFilter(InputFilterInterface $inputFilter) {
		throw new \Exception("Not used");
	}

	/* (non-PHPdoc)
	 * @see \Zend\InputFilter\InputFilterAwareInterface::getInputFilter()
	 */
	public function getInputFilter() {
		if (!$this->inputFilter) {
			$inputFilter = new InputFilter();
			$factory = new InputFactory();
			
			$inputFilter->add($factory->createInput(array(
					'name'     => 'id',
					'required' => true,
					'filters'  => array(
							array('name' => 'Int'),
					),
			)));
			
			$inputFilter->add($factory->createInput(array(
					'name'     => 'cmt',
					'required' => true,
			
			)));
			
			$inputFilter->add($factory->createInput(array(
					'name'     => 'hoten',
					'required' => true,
			
			)));
			
			$inputFilter->add($factory->createInput(array(
					'name'     => 'ngaysinh',
					'required' => true,
			
			)));
			
			$inputFilter->add($factory->createInput(array(
					'name'     => 'gioitinh',
			)));
			
			$inputFilter->add($factory->createInput(array(
					'name'     => 'diachi',
			)));
			
			$inputFilter->add($factory->createInput(array(
					'name'     => 'motabenh',
					'required' => true,
			)));
			
			$this->inputFilter = $inputFilter;
		}	
		return $this->inputFilter;
	}

    
}
